import { cssPrefix } from '../baseData';

let PopupConfig = {
  bodyStyle: {},    // Popup body 样式 object
  cancelText: '取消',   // 取消按钮文字 string
  closable: true,   // 是否显示右上角的关闭按钮 boolean
  footer: true,   // 底部内容，当不需要默认底部按钮时，可以设为 footer={false/null} string|ReactNode
  mask: true,   // 是否展示遮罩 Boolean
  maskClosable: true,   // 点击蒙层是否允许关闭 	boolean
  maskStyle: {},    // 遮罩样式 	object
  okText: '确定',   // 确认按钮文字 string
  okType: 'primary',    // 确认按钮类型 string
  okButtonProps: {},  // ok 按钮 props  ButtonProps
  cancelButtonProps: {},  // cancel 按钮 props  ButtonProps
  title: '',    // 标题 string|ReactNode
  visible: false,  // 对话框是否可见 boolean
  width: 'auto',    // 宽度 string|number
  wrapClassName: '',     // 对话框外层容器的类名 string
  zIndex: 1000,   // 设置 Popup 的 z-index Number
  onCancel: null,   // 点击遮罩层或右上角叉或取消按钮的回调 function({...this.state})
  onOk: null,   // 点击确定回调 function({...this.state})
  keyboardEsc: true  // 是否支持键盘esc关闭 boolean
};

let ConfirmConfig = {
  ...PopupConfig,
  container: document.body,
  visible: true,
  keyboardEsc: false,
  maskClosable: false,
  content: '',
  width: 400,
  wrapClassName: `${cssPrefix}popup-confirm-wrap`,
  iconType: 'question-circle',
  closable: false,
  footer: false,
  popupFunType: 'confirm',
}

let InfoConfig = {
  ...ConfirmConfig,
  wrapClassName: `${cssPrefix}popup-info-wrap`,
  iconType: 'info',
  popupFunType: 'info'
}

let SuccessConfig = {
  ...ConfirmConfig,
  wrapClassName: `${cssPrefix}popup-success-wrap`,
  iconType: 'success',
  popupFunType: 'success'
}

let ErrorConfig = {
  ...ConfirmConfig,
  width: 300,
  wrapClassName: `${cssPrefix}popup-error-wrap`,
  iconType: 'close-circle',
  popupFunType: 'error'
}

let WarningConfig = {
  ...ConfirmConfig,
  wrapClassName: `${cssPrefix}popup-warning-wrap`,
  iconType: 'warning',
  popupFunType: 'warning'
}

let LoadingConfig = {
  ...ConfirmConfig,
  width: 30,
  wrapClassName: `${cssPrefix}popup-loading-wrap`,
  iconType: 'loading',
  popupFunType: 'loading'
}

let MsgConfig = {
  ...ConfirmConfig,
  width: 230,
  time: 2000,
  mask: false,
  wrapClassName: `${cssPrefix}popup-msg-wrap`,
  iconType: 'msg',
  popupFunType: 'msg'
}

module.exports = {
  PopupConfig,
  ConfirmConfig,
  InfoConfig,
  SuccessConfig,
  ErrorConfig,
  WarningConfig,
  LoadingConfig,
  MsgConfig,
}